/*
 *    Copyright (c) 2018-2025, bfcloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: bfcloud
 */

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/ceping/jxevalvote/page',
    method: 'get',
    params: query
  })
}
export function wdXuanPiaoNew(query) {
  // return request({
  //   url: '/ceping/jxevalvote/page',
  //   method: 'get',
  //   params: query
  // })
}

export function addObj(obj) {
  return request({
    url: '/ceping/jxevalvote',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/ceping/jxevalvote/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/ceping/jxevalvote/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/ceping/jxevalvote',
    method: 'put',
    data: obj
  })
}

/**
 * 我的选票
 * @param xpCode 主票票号
 * @returns {*}
 */
export function wdXuanPiaoXpNew(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/wdXuanPiaoXp',
    method: 'get',
    params: obj
  })
}

/**
 * 我的选票
 * @param xpCode 主票票号
 * @returns {*}
 */
export function wdXuanPiaoXpNewSm(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/wdXuanPiaoXpSm',
    method: 'post',
    data: obj
  })
}


/**
 * 我的选票(实名)
 * @param id 会议ID
 * @returns {*}
 */
export function wdXuanPiaoSm(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/wdXuanPiaoSm',
    method: 'post',
    data: obj
  })
}

/**
 * 我的选票
 * @param id 会议ID
 * @returns {*}
 */
export function getMySheet(id) {
  return request({
    url: '/ceping/anonymous/jxevalvote/getMySheet/' + id,
    method: 'get'
  })
}

/**
 * 选票详细信息
 * @param id 选票ID
 * @returns {*}
 */
export function xpInfo(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/xpInfo',
    method: 'get',
    params: obj
  })
}

/**
 * 实名选票详细信息
 * @param id 选票ID
 * @returns {*}
 */
export function xpInfoSm(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/xpInfosm',
    method: 'post',
    data: obj
  })
}

export function daFenCp(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/daFenCp',
    method: 'post',
    data: obj
  })
}

export function anonymousSelhdidList(id) {
  return request({
    url: '/ceping/anonymous/jxevalvote/selhdidList/' + id,
    method: 'get'
  })
}

export function getObjNew(id) {
  return request({
    url: '/ceping/anonymous/jxevalvote/evalActiviy/' + id,
    method: 'get'
  })
}

export function delDaFenCp(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/delDaFenCp',
    method: 'post',
    data: obj
  })
}

/**
 * 根据选票详细信息获取被打票的人员数据
 * @param id 选票ID
 * @returns {*}
 */
export function xpInfoHz(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/xpInfoHz',
    method: 'post',
    data: obj
  })
}

/**
 * 根据选票详细信息获取被打票的人员数据(实名)
 * @param id 选票ID
 * @returns {*}
 */
export function xpInfoHzSm(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/xpInfoHzSm',
    method: 'post',
    data: obj
  })
}


/**
 * 保存问答题
 * @param obj
 * @returns {*}
 */
export function daFenCpAnswer(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/daFenCpAnswer',
    method: 'post',
    data: obj
  })
}

/**
 * 判断活动中所有票是否完成打票
 * @param obj
 * @returns {*}
 */
export function judgeTicketComplete(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/judgeTicketComplete',
    method: 'post',
    data: obj
  })
}
/**
 * 判断活动中所有票实名的是否完成打票
 * @param obj
 * @returns {*}
 */
export function judgeTicketCompleteSm(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/judgeTicketCompleteSm',
    method: 'post',
    data: obj
  })
}

/**
 * 更新当前打票状态
 * @param obj
 * @returns {*}
 */
export function currentPageSave(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/currentPageSave',
    method: 'post',
    data: obj
  })
}

/**
 * 获取未打票的票信息
 * @param obj
 * @returns {*}
 */
export function getUnPickTicket(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/getUnPickTicket',
    method: 'post',
    data: obj
  })
}
/**
 * 获取未打票的票信息(实名)
 * @param obj
 * @returns {*}
 */
export function getUnPickTicketSm(obj) {
  return request({
    url: '/ceping/anonymous/jxevalvote/getUnPickTicketSm',
    method: 'post',
    data: obj
  })
}

